<%@page import="com.opensymphony.xwork2.ActionContext"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"%>

<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html>
<script src="http://how2j.cn/study/js/jquery/2.0.0/jquery.min.js"></script>
<link href="http://how2j.cn/study/css/bootstrap/3.3.6/bootstrap.min.css" rel="stylesheet">
<script src="http://how2j.cn/study/js/bootstrap/3.3.6/bootstrap.min.js"></script>
<head>
<script type="text/javascript">
function submin(){
	var objselectValue = new Array();
    var bookselectValue= new Array();
    var objflag = false;
    var objselect = document.getElementsByName("objselect");
    for(var i=0;i<objselect.length;i++)
        {
    	//判断是否选择该课程
        if(objselect[i].checked){
                objselectValue[i]=objselect[i].value+"";
                alert(objselectValue[i]);
                objflag = true;
        }
    }
    if(objflag==false)
        {
        alert("你没有选择课程，请重新选课");
        return false;
        }else{
			document.getElementById("updateselect").submit();
		}
	}
</script>
</head>
<body>
	<form method="post" action="Updteot" id="updateselect" >

		<div class="div_4">
			<fieldset>
				<legend>二次确认所选课程</legend>
				<table class="table table-bordered">
					<tr style="font-size:14px;">
						<th width="4%">选课</th>
						<th width="8%">课程名称</th>
						<th width="8%">课程代码</th>
						<th width="8%">教师姓名</th>
						<th width="8%">上课时间</th>
						<th width="6%">上课地点</th>
						<th width="4%">学分</th>
						<th width="6%">周学时</th>
						<th width="7%">起始结束周</th>
						<th width="4%">容量</th>
						<th width="4%">余量</th>
						<th width="6%">课程性质</th>
						<th width="8%">开课学院</th>
						<th width="8%">考试时间</th>
					</tr>
					<!--课程供选数据填充处-->
					<s:iterator value="#request.cruObjects">
					<s:if test="objnum!=null">
						<tr style="font-size: 13px">
							<s:if test="allowance>0">
							<td>
							<input type="checkbox" name="objselect" value="<s:property value="objnum"/>">
							</td>
							</s:if>
							
							<s:if test="allowance<=0">
							<td>
							<input type="checkbox"  disabled="disabled" name="objselect" value="<s:property value="objnum"/>">
							</td>
							</s:if>
							<td><s:property value="objname"/></td>
							<td><s:property value="objnum"/></td>
							<td><s:property value="teaname"/></td>
							<td><s:property value="objtime"/></td>
							<td><s:property value="place"/></td>
							<td><s:property value="credits"/></td>
							<td><s:property value="ltimes"/></td>
							<td><s:property value="objtime"/></td>
							<td><s:property value="allowance"/></td>
							<td><s:property value="capacity"/></td>
							<td>
								<s:if test="objnature=0">
									选修
								</s:if>
								<s:if test="objnature=1">
									必修
								</s:if>
							</td>
							<td><s:property value="clgname"/></td>
							<td><s:property value="examtime"/></td>
						</tr>
						</s:if>
					</s:iterator>
					<td colspan="15" style="font-size: 13px;align="center">
							<input type="button" onclick="submin();" value=" 提交  " class="btn" id="objsubmit">
						</td>
				</table>
			</fieldset>
		</div>
		</form>
</body>
</html>